home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / snip1292.zip / BIPORT.C < prev    next >
C/C++ Source or Header  |  1992-12-26  |  1KB  |  52 lines

  1. /*
  2. **  Public domain demo by Bob Stout
  3. */
  4.  
  5. /*
  6. **  BIPORT.H - Port TC/TC++/BC++ code using register pseudovariables
  7. */
  8.  
  9. #include <dos.h>
  10.  
  11. extern union  REGS  BIP_regs_;
  12. extern struct SREGS BIP_sregs_;
  13.  
  14. #define _AX BIP_regs_.x.ax
  15. #define _BX BIP_regs_.x.bx
  16. #define _CX BIP_regs_.x.cx
  17. #define _DX BIP_regs_.x.dx
  18. #define _AH BIP_regs_.h.ah
  19. #define _AL BIP_regs_.h.al
  20. #define _BH BIP_regs_.h.ah
  21. #define _BL BIP_regs_.h.al
  22. #define _CH BIP_regs_.h.ah
  23. #define _CL BIP_regs_.h.al
  24. #define _DH BIP_regs_.h.ah
  25. #define _DL BIP_regs_.h.al
  26. #define _SI BIP_regs_.x.si
  27. #define _DI BIP_regs_.x.di
  28. #define _CF BIP_regs_.x.cflag
  29. #define _FF BIP_regs_.x.flags
  30. #define _ES BIP_sregs_.es
  31. #define _CS BIP_sregs_.cs
  32. #define _SS BIP_sregs_.ss
  33. #define _DS BIP_sregs_.ds
  34. #define regload_() segread(&BIP_sregs_)
  35.  
  36. unsigned _pascal geninterrupt(int);
  37.  
  38. /*
  39. **  BIPORT.C - Port TC/TC++/BC++ code using register pseudovariables
  40. */
  41.  
  42. #include "biport.h"
  43.  
  44. union  REGS  BIP_regs_;
  45. struct SREGS BIP_sregs_;
  46.  
  47. unsigned _pascal geninterrupt(int int_no)
  48. {
  49.       int86x(int_no, &BIP_regs_, &BIP_regs_, &BIP_sregs_);
  50.       return BIP_regs_.x.ax;
  51. }
  52.